package cn.school.controller.attendance;

import cn.school.attendance.dormitory.entity.DormitoryAttendanceDo;
import cn.school.attendance.dormitory.entity.DormitoryStatusDo;
import cn.school.attendance.dormitory.entity.DormitoryStudentInfo;
import cn.school.attendance.dormitory.service.DormitoryAttendanceService;
import cn.school.attendance.dormitory.vo.DormitoryAttendanceVo;
import cn.school.basics.vo.BaseSpaceLocationVO;
import cn.school.common.api.CommonPage;
import cn.school.common.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @className: DormitoryAttendanceController
 * @author: Alex
 * @date: 2023/3/29
 **/
@RestController
@RequestMapping("/attendance/dormitory")
@Api(tags = "dormitory attendance => 宿舍考勤")
public class DormitoryAttendanceController {

	@Autowired
	private DormitoryAttendanceService dormitoryAttendanceService;

//	@PostMapping("/update")
//	public CommonResult updateAttendance(@RequestBody DormitoryAttendanceDo attendance){
//
//	}

//	// 查看宿舍出勤情况 支持搜索分页  宿舍编号搜索
//	@PostMapping("/getDormitoryAttendance")
//	@ApiOperation("getDormitoryAttendance => 分页查询宿舍考勤列表")
//	public CommonResult<CommonPage<DormitoryStatusDo>> getDormitoryAttendancePageList(@RequestBody BaseSpaceLocationVO vo){
//		CommonPage<DormitoryStatusDo> ipage = dormitoryAttendanceService.findDormitoryAttendanceStatus(vo);
//		return CommonResult.success(ipage);
//	}
//
//	// 考勤登记
//	@PostMapping("/getDormitoryStudentInfo")
//	@ApiOperation("getDormitoryStudentInfo => 查询学生宿舍考勤状态")
//	public CommonResult<List<DormitoryStudentInfo>> getDormitoryStudentInfo(@RequestBody BaseSpaceLocationVO vo) {
//		List<DormitoryStudentInfo> studentInfos = dormitoryAttendanceService.getDormitoryStudentInfos(vo);
//		return CommonResult.success(studentInfos);
//	}
//
//	// 修改学生考勤状态
//	@PostMapping("/editDormitoryAttendance")
//	@ApiOperation("editDormitoryAttendance => 修改学生宿舍考勤状态")
//	public CommonResult<Integer> editDormitoryAttendanceStatus(@RequestBody List<DormitoryStudentInfo> list) {
//		boolean result = dormitoryAttendanceService.editAttendanceStatus(list);
//		if (!result) {
//			return CommonResult.failed();
//		}
//		return CommonResult.success();
//	}
//	// 考勤统计
//	@PostMapping("/getAttendanceStatistics")
//	@ApiOperation("getAttendanceStatistics => 查询宿舍考勤统计数据")
//	public CommonResult<CommonPage<DormitoryStatusDo>> getAttendanceStatistics(@RequestBody BaseSpaceLocationVO vo) {
//		CommonPage<DormitoryStatusDo> ipage = dormitoryAttendanceService.findDormitoryAttendanceStatus(vo);
//		return CommonResult.success(ipage);
//	}
//
//	// 定位打卡记录 更新考勤状态
//	@PostMapping("/clockIn")
//	@ApiOperation("clockIn => 手机定位打卡")
//	public CommonResult<String> updateAttendanceStatus(@RequestBody DormitoryAttendanceVo vo) {
//		int num = dormitoryAttendanceService.updateAttendanceStatus(vo);
//		if (num < 0) {
//			return CommonResult.failed();
//		}
//		return CommonResult.success();
//	}




}
